<!DOCTYPE html>
<html>
<head>
<div th:replace="common/common_resource :: common_css"></div>
<title th:text="${application.shop_name} +' | 用户维护'"></title>
<style type="text/css">
img {
	cursor: pointer;
	transition: all 0.6s;
}

img:hover {
	transform: scale(1.4);
}
</style>
</head>
<body class="hold-transition skin-blue sidebar-mini" >
	<div class="wrapper">
		<div th:replace="common/common_h5 :: loginAndLogout"></div>
		<div th:replace="common/common_h5 :: upload_image"></div>
		<div th:replace="common/common_h5 :: left_menu"></div>
		<div class="content-wrapper">
			<section class="content">
				<div class="row">
					<div class="col-xs-12">
						<div class="box">
							<div class="box-header">
								<div class="row">
									<div class="col-xs-4">
										<div class="modal fade " id="users_update" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
											<div class="modal-dialog ">
												<div class="modal-content">
													<div class="modal-header bg-blue">
														<button  type="button"  name="cleanAll" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
														<h4 class="modal-title" id="myModalLabel">修改用户权限</h4>
													</div>
													<div class="modal-body">
														<form th:action="${#httpServletRequest.getContextPath()}+'/TblWxUsers/updateUsers'" method="post">
														 	<input id="menuUuid" name="menuUuid" type="hidden" th:value="${menuUuid!=null}?${menuUuid}:'110'"/>
														 	<input name="userId" id="userIdss" th:value="${dataBean!=null? dataBean.userId:''}" type="hidden"/>
														 	<input name="imginfoId" id="imginfoId" th:value="${dataBean!=null? dataBean.imginfoId:''}" type="hidden"/>
															<div class="box-body">
																<div class="form-group">
																	<label for="depName">用户状态</label>
																	<div class="radio" id="radiodiv">
																			<label>
																				<input id="userStatus" th:checked="(${dataBean!=null? dataBean.userStatus:''} == 1)" name="userStatus" type="radio" value="1">正常
																			</label>
																			<label>
																				<input id="userStatus" th:checked="(${dataBean!=null? dataBean.userStatus:''} == 2)"  name="userStatus" type="radio" value="2">异常
																			</label>
																			<label>
																				<input id="userStatus" th:checked="(${dataBean!=null? dataBean.userStatus:''} == 3)" name="userStatus" type="radio" value="3">冻结
																			</label>
																			<label>
																				<input id="userStatus"  th:checked="(${dataBean!=null? dataBean.userStatus:''} == 4)" name="userStatus" type="radio" value="4">删除
																			</label>
																	</div>
																</div>
																<div class="form-group">
																	<label for="depTele">会员等级<font color="red">&nbsp;&nbsp;*</font></label>
																	<select class="form-control" id="rankId" name="rankId">
													                    <option  th:each="userrank,userrankStat:${userrankList}" th:value="${userrank.rankId}" th:text="${userrank.rankName}" th:selected="(${dataBean!=null? dataBean.rankId:''} == ${userrank.rankId})"></option>
													                 </select>
																</div>
																
																<div class="form-group">
																	<label for="userTatolscore">用户积分</label>
																	<div class="row">
																		<div class="col-xs-6 text-left">
																			<input id="userTatolscore" name="userTatolscore" th:value="${dataBean!=null? dataBean.userTatolscore:''}"  readonly="readonly"/>
																		</div>
																		<div class="col-xs-6 text-left">
																			<label>
																				<input id="imginfoStatus" th:checked="(${dataBean!=null? dataBean.reduce:''} == 0)" name="reduce" type="radio" value="0">减去
																			</label>
																			<label>
																				<input id="imginfoStatus" th:checked="(${dataBean!=null? dataBean.reduce:''} == 1)" name="reduce" type="radio" value="1">增加
																			</label>
																			<input name="addUserTatolscore" id="addUserTatolscore" th:value="${dataBean!=null? dataBean.addUserTatolscore:''}"/>
																		</div>
																	</div>
																</div>
																
															</div>
															<div class="modal-footer">
																<div class="row">
																	<div class="col-xs-6 text-center">
																	</div>
																	<div class="col-xs-6 text-right">
																		<button type="submit" class="btn btn-primary">确&nbsp;&nbsp;&nbsp;&nbsp;定</button>
																	</div>
																</div>
															</div>
														</form>
													</div>
												</div>
											</div>
										</div>
									</div>
									<div class="col-xs-4">
										<h3 class="box-title">用户数据列表</h3>
									</div>
									<div class="col-xs-4"></div>
								</div>
							</div>
							<div class="box-body table-responsive">
								<table id="example2" class="table table-bordered table-striped ">
									<thead>
										<tr class="bg-green ">
											<th>序号</th>
											<th>头像</th>
											<th>登陆名</th>
											<th>电话</th>
											<th>积分</th>
											<th>总消费</th>
											<th>最近登陆</th>
											<th>会员等级</th>
											<th>状态</th>
											<th>操作</th>
										</tr>
									</thead>
									<tbody>
										<tr th:class="${usersStat.index % 2 ==0}? '' : 'bg-gray'" th:each="users,usersStat : ${usersList}">
											<td th:text="${usersStat.index+1}"></td>
											<td>
												<div style="float: left; margin: 10px; overflow: hidden;">
													<img  th:if="${users!=null && users.imginfoPath!=''}" class="lazy img-md" height="150px" width="200px" th:src="@{${#strings.append(pathfile,users!=null?users.imginfoPath:'')}}">
												</div>
											</td>
											<td th:text="${users.userName}"></td>
											<td th:text="${users.userPhone}"></td>
											<td th:text="${users.userTatolscore}"></td>
											<td th:text="${users.userTotalamt}"></td>
											<td th:text="${users.userLastloginTimeView}"></td>
											<td th:text="${users.userrank!=null}?${users.userrank.rankName}:''"></td>
											<td >
												<span th:if="${users.userStatus==1}" class="fa fa-circle text-success">正常</span>
												<span th:if="${users.userStatus==2}" class="fa fa-circle text-warning">异常</span>
												<span th:if="${users.userStatus==3}" class="fa fa-circle text-danger">冻结</span>
												<span th:if="${users.userStatus==4}" class="fa fa-circle text-default">删除</span>
											</td>
											<td>&nbsp;&nbsp;&nbsp;&nbsp;
												<div class="row">
													<div class="col-xs-6 text-right">
														<form th:action="${#httpServletRequest.getContextPath()}+'/TblWxUsers/gotoUserDetail'">
															<input id="menuUuid" name="menuUuid" type="hidden" th:value="${menuUuid!=null}?${menuUuid}:'110'"/>
															<input type="hidden" th:value="${users.userId}" name="userId" id="${userId}"/>
															<button type="submit" class="fa fa-file btn btn-primary">详情</button>&nbsp;&nbsp;&nbsp;&nbsp;
														</form>
													</div>
													<div class="col-xs-6 text-left">
														<a href="javascript:void(0);" th:id="${users.userId}" class="fa fa-wrench btn btn-primary example5-3-2" >修改权限</a>
														<input type="hidden"  th:value="${users.userStatus}">
														<input type="hidden"  th:value="${users.userrank!=null}?${users.userrank.rankId}:''">
														<input type="hidden"  th:value="${users.userTatolscore}">
													</div>
												</div>
											</td>
										</tr>
									</tbody>
								</table>
							</div>
						</div>
					</div>
				</div>
			</section>
		</div>
		<div th:replace="common/common_h5 :: down_foot"></div>
		<div th:replace="common/common_h5 :: down_sidebar"></div>
		<div th:replace="common/common_h5 :: error_message"></div>
		<div class="control-sidebar-bg"></div>
		<div th:replace="common/common_resource :: common_js"></div>
	    <script th:src="@{/admin_js/basics/process/users_list.js}"></script>
</body>
</html>
